<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<center>
	<div id="page">
		<c:if test="${param.currPage!=1}">
			<a title="${talk.goindex }"
				href="search?q=${param.queryKey}&page=1&pageSize=${param.pageSize}">|&lt;</a>
		</c:if>
		<c:if test="${param.currPage==1}">
			<a title="${talk.goindex }" style="color: gray">|&lt;</a>
		</c:if>
		<c:if test="${param.currPage>1}">
			<a title="${talk.gofrontpage }"
				href="search?q=${param.queryKey}&page=${param.currPage-1}&pageSize=${pageSize}">&lt;</a>
		</c:if>
		<c:if test="${param.currPage<=1}">
			<a title="${talk.gofrontpage }" style="color: gray">&lt;</a>
		</c:if>
		<%
			int curr = Integer.parseInt(request.getParameter("currPage"));
			int count = Integer.parseInt(request.getParameter("pageCount"));
			int start = curr - 4;
			start = start < 1 ? 1 : start;
			int end = start + 9;
			end = end > count ? count : end;
			for (int i = start; i <= end; i++) {
				if (i == curr) {
		%><a style="color: gray"><%=i%></a>
		<%
			} else {
		%><a
			href="search?q=${param.queryKey}&page=<%=i%>&pageSize=${param.pageSize}"><%=i%></a>
		<%
			}
			}
		%>
		<c:if test="${param.currPage!=param.pageCount}">
			<a title="${talk.gonextpage }"
				href="search?q=${param.queryKey}&page=${param.currPage+1}&pageSize=${param.pageSize}">&gt;</a>
		</c:if>
		<c:if test="${param.currPage==param.pageCount}">
			<a title="${talk.gonextpage }" style="color: gray">&gt;</a>
		</c:if>
		<c:if test="${param.currPage!=param.pageCount}">
			<a title="${talk.golastpage }"
				href="search?q=${param.queryKey}&page=${param.pageCount}&pageSize=${param.pageSize}">&gt;|</a>
		</c:if>
		<c:if test="${param.currPage==param.pageCount}">
			<a title="${talk.golastpage }" style="color: gray">&gt;|</a>
		</c:if>
	</div>
</center>
